package com.apes.fn.scm.commodityInquiry.repository;

import com.apes.fn.scm.commodityInquiry.model.ExternalInquiry;
import com.apes.fn.scm.commodityInquiry.model.ExternalInquiryItem;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

public interface ExternalInquiryRepository extends CustomRepository<ExternalInquiry, String> {
    List<ExternalInquiry> findBySourceBusinessKey(@Param("SourceBusinessKey") String SourceBusinessKey);

    @Query(value = "SELECT A.ANSWER_ID, A.ANSWER_DATE FROM PUR_EXTERNAL_INQUIRY A WHERE A.ID = :ID", nativeQuery = true)
    Map findOneAnswer(@Param("ID") String id);
}
